/**
 * 对数组进行排序
 * @param list
 * @returns {Array}
 */
export function randomSort(list = []) {
  if (!(list instanceof Array)) {
    return [];
  }
  const len = list.length;
  for (let i = 0; i < len; i++) {
    let item = list[i];
    let exchangeIndex = Math.floor(Math.random()*len);
    list[i] = list[exchangeIndex];
    list[exchangeIndex] = item;
  }
  return list;
}
